package com.sh.read_configuration_file;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class ReadFIle {
    public static void main(String[] args) {
        Properties properties = new Properties();
        try (FileInputStream fis = new FileInputStream("D:\\java_workspace\\allproject\\learn\\src\\main\\resources\\shihao.properties");) {
            properties.load(fis);
            String propertyValue1 = properties.getProperty("name");
            String propertyValue2 = properties.getProperty("age");
            System.out.println("Value of key1: " + propertyValue1);
            System.out.println("Value of key2: " + propertyValue2);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
